package collect;

import java.util.LinkedList;

import dbaccess.dbInteract;

/**
 * MarketCollections will connect with the backend database to obtain all the information regarding
 * market names and symbols. Specifically, it will interface with the Markets table.
 * 
 * @author henry
 *
 */
public class MarketCollections {
	
	/**
	 * All the information is stored in a linked list, containing elements of type MarketPairs
	 */
	public static LinkedList<MarketPairs> ll = new LinkedList<MarketPairs>();
	
	/**
	 * The default constructor for this class. It queries the database, then stores the results in
	 * a linked list.
	 */
	public MarketCollections(){
		
		//		ll.add(new MarketPairs("S&P 500", "^GSPC"));
		//		ll.add(new MarketPairs("NIKKEI 225", "^N225"));
		//		ll.add(new MarketPairs("Dow Jones Industrial", "^DJI"));
		//		ll.add(new MarketPairs("NASDAQ", "^IXIC"));
		
		dbInteract.dbLoadIndexPairs(ll);
	}
	
	/**
	 * Returns a linked list with the names and symbols of the markets in the database
	 * @return A linked list with MarketPairs, containing the names and symbols of all markets in the database
	 */
	public LinkedList<MarketPairs> getMarkets(){return ll;}

}
